package com.wcgksoft.common.util.getdata;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <pre>
 *     @author  : FlySand
 *     @e-mail  : 1156183505@qq.com
 *     @time    : 2019/5/8.
 *     @desc    : 基础数据包
 *     @测试报文：
 *     <p>
 *         FE DC 01 13 32 51 22 A5 79 00 00 00 00 03 00 30 00 00 01 01 00 00 01 00 00 00 10 F0 FF FF FF 1E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 *     </p>
 * </pre>
 */
public final class JXCTPacket implements Serializable {


    /**
     * 帧头(2)
     */
    private String header;

    /**
     * 版本(1)
     */
    private String version;

    /**
     * 设备 ID(6)
     */
    private String deviceNumber;
    /**
     * 传输 Session(4)
     * 传输 Session 为 4 字节，由设备指定，
     * 每次发送自增1，用来标识设备的传输顺序。
     */
    private String session;
    /**
     * 命令字节
     */
    private String order;
    /**
     * 长度(2)
     */
    private String length;
    /**
     * 消息体
     */
    private List<String> body = new ArrayList<String>();
    /**
     * 包尾
     * 校验和(1)
     */
    private String end;

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getDeviceNumber() {
        return deviceNumber;
    }

    public void setDeviceNumber(String deviceNumber) {
        this.deviceNumber = deviceNumber;
    }

    public String getSession() {
        return session;
    }

    public void setSession(String session) {
        this.session = session;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public List<String> getBody() {
        return body;
    }

    public void setBody(List<String> body) {
        this.body = body;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }


    @Override
    public String toString() {
        return "JXCTPacket{" +
                "header='" + header + '\'' +
                ", version='" + version + '\'' +
                ", deviceNumber='" + deviceNumber + '\'' +
                ", session='" + session + '\'' +
                ", order='" + order + '\'' +
                ", length='" + length + '\'' +
                ", body='" + AnalysisHelper.toListString(body, 4) + '\'' +
                ", end='" + end + '\'' +
                '}';
    }
}
